-
Notifications
You must be signed in to change notification settings - Fork 324
Introducing TagMap EntryReader #10339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
EntryIterator and EntryChangeIterator are arguably redundant
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 57 metrics, 8 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~5698bff9b7, baseline=1.59.0-SNAPSHOT~25a3dc370c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.089 s) : 0, 1088858
Total [baseline] (8.801 s) : 0, 8800959
Agent [candidate] (1.097 s) : 0, 1097477
Total [candidate] (8.893 s) : 0, 8892753
section iast
Agent [baseline] (1.227 s) : 0, 1226603
Total [baseline] (9.371 s) : 0, 9371482
Agent [candidate] (1.232 s) : 0, 1232092
Total [candidate] (9.407 s) : 0, 9407312
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~5698bff9b7, baseline=1.59.0-SNAPSHOT~25a3dc370c
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.2 ms) : 0, 1200
BytebuddyAgent [baseline] (655.075 ms) : 0, 655075
BytebuddyAgent [candidate] (660.058 ms) : 0, 660058
GlobalTracer [baseline] (283.602 ms) : 0, 283602
GlobalTracer [candidate] (286.085 ms) : 0, 286085
AppSec [baseline] (32.545 ms) : 0, 32545
AppSec [candidate] (32.941 ms) : 0, 32941
Debugger [baseline] (67.171 ms) : 0, 67171
Debugger [candidate] (67.66 ms) : 0, 67660
Remote Config [baseline] (634.835 µs) : 0, 635
Remote Config [candidate] (634.711 µs) : 0, 635
Telemetry [baseline] (9.034 ms) : 0, 9034
Telemetry [candidate] (9.112 ms) : 0, 9112
Flare Poller [baseline] (3.843 ms) : 0, 3843
Flare Poller [candidate] (3.906 ms) : 0, 3906
section iast
crashtracking [baseline] (1.191 ms) : 0, 1191
crashtracking [candidate] (1.209 ms) : 0, 1209
BytebuddyAgent [baseline] (793.598 ms) : 0, 793598
BytebuddyAgent [candidate] (798.568 ms) : 0, 798568
GlobalTracer [baseline] (257.213 ms) : 0, 257213
GlobalTracer [candidate] (257.154 ms) : 0, 257154
IAST [baseline] (27.064 ms) : 0, 27064
IAST [candidate] (26.902 ms) : 0, 26902
AppSec [baseline] (34.587 ms) : 0, 34587
AppSec [candidate] (32.964 ms) : 0, 32964
Debugger [baseline] (64.859 ms) : 0, 64859
Debugger [candidate] (66.916 ms) : 0, 66916
Remote Config [baseline] (578.054 µs) : 0, 578
Remote Config [candidate] (572.555 µs) : 0, 573
Telemetry [baseline] (8.401 ms) : 0, 8401
Telemetry [candidate] (8.489 ms) : 0, 8489
Flare Poller [baseline] (3.57 ms) : 0, 3570
Flare Poller [candidate] (3.615 ms) : 0, 3615
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~5698bff9b7, baseline=1.59.0-SNAPSHOT~25a3dc370c
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.085 s) : 0, 1085321
Total [baseline] (10.866 s) : 0, 10865783
Agent [candidate] (1.087 s) : 0, 1086681
Total [candidate] (10.782 s) : 0, 10781603
section appsec
Agent [baseline] (1.269 s) : 0, 1269085
Total [baseline] (11.132 s) : 0, 11131815
Agent [candidate] (1.273 s) : 0, 1273016
Total [candidate] (11.006 s) : 0, 11005762
section iast
Agent [baseline] (1.226 s) : 0, 1226034
Total [baseline] (11.187 s) : 0, 11187489
Agent [candidate] (1.223 s) : 0, 1223153
Total [candidate] (11.153 s) : 0, 11152547
section profiling
Agent [baseline] (1.206 s) : 0, 1206072
Total [baseline] (10.907 s) : 0, 10906568
Agent [candidate] (1.212 s) : 0, 1211895
Total [candidate] (10.994 s) : 0, 10993917
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~5698bff9b7, baseline=1.59.0-SNAPSHOT~25a3dc370c
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.175 ms) : 0, 1175
crashtracking [candidate] (1.181 ms) : 0, 1181
BytebuddyAgent [baseline] (651.52 ms) : 0, 651520
BytebuddyAgent [candidate] (652.664 ms) : 0, 652664
GlobalTracer [baseline] (282.924 ms) : 0, 282924
GlobalTracer [candidate] (283.484 ms) : 0, 283484
AppSec [baseline] (32.549 ms) : 0, 32549
AppSec [candidate] (32.621 ms) : 0, 32621
Debugger [baseline] (68.237 ms) : 0, 68237
Debugger [candidate] (67.748 ms) : 0, 67748
Remote Config [baseline] (648.001 µs) : 0, 648
Remote Config [candidate] (630.681 µs) : 0, 631
Telemetry [baseline] (8.934 ms) : 0, 8934
Telemetry [candidate] (8.959 ms) : 0, 8959
Flare Poller [baseline] (3.812 ms) : 0, 3812
Flare Poller [candidate] (3.798 ms) : 0, 3798
section appsec
crashtracking [baseline] (1.18 ms) : 0, 1180
crashtracking [candidate] (1.209 ms) : 0, 1209
BytebuddyAgent [baseline] (692.709 ms) : 0, 692709
BytebuddyAgent [candidate] (696.405 ms) : 0, 696405
GlobalTracer [baseline] (259.514 ms) : 0, 259514
GlobalTracer [candidate] (260.427 ms) : 0, 260427
IAST [baseline] (24.436 ms) : 0, 24436
IAST [candidate] (24.854 ms) : 0, 24854
AppSec [baseline] (172.393 ms) : 0, 172393
AppSec [candidate] (174.718 ms) : 0, 174718
Debugger [baseline] (69.314 ms) : 0, 69314
Debugger [candidate] (65.983 ms) : 0, 65983
Remote Config [baseline] (791.74 µs) : 0, 792
Remote Config [candidate] (764.115 µs) : 0, 764
Telemetry [baseline] (9.43 ms) : 0, 9430
Telemetry [candidate] (9.295 ms) : 0, 9295
Flare Poller [baseline] (3.795 ms) : 0, 3795
Flare Poller [candidate] (3.717 ms) : 0, 3717
section iast
crashtracking [baseline] (1.181 ms) : 0, 1181
crashtracking [candidate] (1.181 ms) : 0, 1181
BytebuddyAgent [baseline] (793.287 ms) : 0, 793287
BytebuddyAgent [candidate] (791.139 ms) : 0, 791139
GlobalTracer [baseline] (256.29 ms) : 0, 256290
GlobalTracer [candidate] (255.679 ms) : 0, 255679
IAST [baseline] (26.988 ms) : 0, 26988
IAST [candidate] (26.968 ms) : 0, 26968
AppSec [baseline] (34.474 ms) : 0, 34474
AppSec [candidate] (34.243 ms) : 0, 34243
Debugger [baseline] (65.769 ms) : 0, 65769
Debugger [candidate] (65.888 ms) : 0, 65888
Remote Config [baseline] (556.682 µs) : 0, 557
Remote Config [candidate] (593.95 µs) : 0, 594
Telemetry [baseline] (8.405 ms) : 0, 8405
Telemetry [candidate] (8.439 ms) : 0, 8439
Flare Poller [baseline] (3.567 ms) : 0, 3567
Flare Poller [candidate] (3.555 ms) : 0, 3555
section profiling
crashtracking [baseline] (1.207 ms) : 0, 1207
crashtracking [candidate] (1.206 ms) : 0, 1206
BytebuddyAgent [baseline] (701.31 ms) : 0, 701310
BytebuddyAgent [candidate] (705.664 ms) : 0, 705664
GlobalTracer [baseline] (221.349 ms) : 0, 221349
GlobalTracer [candidate] (223.486 ms) : 0, 223486
AppSec [baseline] (32.604 ms) : 0, 32604
AppSec [candidate] (32.572 ms) : 0, 32572
Debugger [baseline] (68.569 ms) : 0, 68569
Debugger [candidate] (68.305 ms) : 0, 68305
Remote Config [baseline] (644.12 µs) : 0, 644
Remote Config [candidate] (658.092 µs) : 0, 658
Telemetry [baseline] (8.946 ms) : 0, 8946
Telemetry [candidate] (9.074 ms) : 0, 9074
Flare Poller [baseline] (3.8 ms) : 0, 3800
Flare Poller [candidate] (3.793 ms) : 0, 3793
ProfilingAgent [baseline] (97.768 ms) : 0, 97768
ProfilingAgent [candidate] (97.131 ms) : 0, 97131
Profiling [baseline] (98.345 ms) : 0, 98345
Profiling [candidate] (97.712 ms) : 0, 97712
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 2 performance regressions! Performance is the same for 15 metrics, 19 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~5698bff9b7, baseline=1.59.0-SNAPSHOT~25a3dc370c
dateFormat X
axisFormat %s
section baseline
no_agent (1.165 ms) : 1154, 1176
. : milestone, 1165,
iast (3.157 ms) : 3112, 3203
. : milestone, 3157,
iast_FULL (5.867 ms) : 5808, 5927
. : milestone, 5867,
iast_GLOBAL (3.544 ms) : 3493, 3595
. : milestone, 3544,
profiling (1.948 ms) : 1931, 1964
. : milestone, 1948,
tracing (1.802 ms) : 1786, 1817
. : milestone, 1802,
section candidate
no_agent (1.189 ms) : 1177, 1200
. : milestone, 1189,
iast (3.15 ms) : 3107, 3194
. : milestone, 3150,
iast_FULL (5.77 ms) : 5713, 5827
. : milestone, 5770,
iast_GLOBAL (3.715 ms) : 3650, 3780
. : milestone, 3715,
profiling (2.189 ms) : 2169, 2209
. : milestone, 2189,
tracing (1.836 ms) : 1820, 1852
. : milestone, 1836,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~5698bff9b7, baseline=1.59.0-SNAPSHOT~25a3dc370c
dateFormat X
axisFormat %s
section baseline
no_agent (18.274 ms) : 18086, 18462
. : milestone, 18274,
appsec (18.484 ms) : 18300, 18668
. : milestone, 18484,
code_origins (17.794 ms) : 17617, 17972
. : milestone, 17794,
iast (17.728 ms) : 17550, 17907
. : milestone, 17728,
profiling (18.53 ms) : 18348, 18713
. : milestone, 18530,
tracing (17.549 ms) : 17375, 17724
. : milestone, 17549,
section candidate
no_agent (18.166 ms) : 17979, 18353
. : milestone, 18166,
appsec (18.883 ms) : 18695, 19072
. : milestone, 18883,
code_origins (17.872 ms) : 17694, 18051
. : milestone, 17872,
iast (17.77 ms) : 17595, 17946
. : milestone, 17770,
profiling (18.909 ms) : 18716, 19103
. : milestone, 18909,
tracing (17.395 ms) : 17224, 17566
. : milestone, 17395,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~5698bff9b7, baseline=1.59.0-SNAPSHOT~25a3dc370c
dateFormat X
axisFormat %s
section baseline
no_agent (14.944 s) : 14944000, 14944000
. : milestone, 14944000,
appsec (14.591 s) : 14591000, 14591000
. : milestone, 14591000,
iast (18.413 s) : 18413000, 18413000
. : milestone, 18413000,
iast_GLOBAL (17.82 s) : 17820000, 17820000
. : milestone, 17820000,
profiling (14.933 s) : 14933000, 14933000
. : milestone, 14933000,
tracing (14.735 s) : 14735000, 14735000
. : milestone, 14735000,
section candidate
no_agent (15.687 s) : 15687000, 15687000
. : milestone, 15687000,
appsec (14.829 s) : 14829000, 14829000
. : milestone, 14829000,
iast (18.208 s) : 18208000, 18208000
. : milestone, 18208000,
iast_GLOBAL (17.697 s) : 17697000, 17697000
. : milestone, 17697000,
profiling (15.02 s) : 15020000, 15020000
. : milestone, 15020000,
tracing (14.604 s) : 14604000, 14604000
. : milestone, 14604000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~5698bff9b7, baseline=1.59.0-SNAPSHOT~25a3dc370c
dateFormat X
axisFormat %s
section baseline
no_agent (1.475 ms) : 1463, 1486
. : milestone, 1475,
appsec (3.631 ms) : 3417, 3846
. : milestone, 3631,
iast (2.216 ms) : 2151, 2281
. : milestone, 2216,
iast_GLOBAL (2.259 ms) : 2193, 2325
. : milestone, 2259,
profiling (2.062 ms) : 2010, 2115
. : milestone, 2062,
tracing (2.041 ms) : 1990, 2092
. : milestone, 2041,
section candidate
no_agent (1.473 ms) : 1461, 1484
. : milestone, 1473,
appsec (3.661 ms) : 3446, 3876
. : milestone, 3661,
iast (2.21 ms) : 2145, 2275
. : milestone, 2210,
iast_GLOBAL (2.26 ms) : 2194, 2325
. : milestone, 2260,
profiling (2.057 ms) : 2005, 2109
. : milestone, 2057,
tracing (2.045 ms) : 1994, 2096
. : milestone, 2045,
|
| * <li>adaptive collision | ||
| * </ul> | ||
| */ | ||
| public interface TagMap extends Map<String, Object>, Iterable<TagMap.Entry> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entry now implements EntryReader, so the updates to code using TagMap are trivial
| /** | ||
| * Visits each Entry in this TagMap This method is more efficient than {@link TagMap#iterator()} | ||
| */ | ||
| void forEach(Consumer<? super TagMap.Entry> consumer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entry now implements EntryReader
And since forEach is primarily used with a lambda and type inferencing, this is often source compatible with existing callers
Fixed bug TagValueConversions.toBoolean Could cause LegacyTagMap.EntryReader to produce incorrect answers to some queries For simplicity, now treating Byte and Short as Integer. That will make calling code doing primitive handling simpler. Fleshing out tests -- more tests to come
Coverage for byte, short, float, and double
| /* | ||
| * Numeric constants - deliberately arranged to allow for checking by using type >= BYTE | ||
| */ | ||
| public static final byte BYTE = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, don't expose ability to construct BYTE and SHORT entries, so I've decided to hide these and treat them at INT.
What Does This Do
Introduces EntryReader as a low allocation means to traverse either a LegacyTagMap or an OptimizedTagMap
TagMap now extends Iterable<EntryReader> rather than Iterable<Entry>
Motivation
EntryReader provides a way to traverse a map with minimal allocation - avoiding the need to create specialized code that is optimal for each map type
In a future change, this capability will be used in the serializers to reduce overhead for OptimizedTagMap without introducing two pieces of code to maintain (one for each map)
Additional Notes
LegacyTagMap reuses a EntryReadingHelper which is updating each time the Iterator advances or the Entry changes in a forEach method. EntryReadingHelper uses TagValueConversions to help unbox / convert objects as needed.
OptimizedTagMap continues to pass the Entry object directly, since Entry objects are EntryReaders.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]